package com.summer.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TaskRunnerPool {
	
	// 单线程池
	private static ExecutorService service = null;
	static {
//		service = Executors.newSingleThreadExecutor();
		service = Executors.newFixedThreadPool(15);
	}

	public static void put(Runnable run) {
		if (run == null) {
			return;
		}
		// 执行
		service.execute(run);
	}

	public static void close() {
		if (service != null) {
			service.shutdown();
			service = null;
		}
	}
	
}